package com.zyf.project.kvdb.protocol.proto;

import com.zyf.project.binaryproto.annotation.DataContract;
import com.zyf.project.binaryproto.annotation.DataField;
import com.zyf.project.binaryproto.type.PrimitiveType;
import com.zyf.project.kvdb.protocol.constants.Constants;

/**
 * <h1>数据库实例基础信息</h1>
 *
 * @author Zhou Yifan
 */
@DataContract(code = Constants.DATABASE_BASE_INFO)
public interface DatabaseBaseInfo {

    /**
     * @return 数据库名称
     */
    @DataField(order = 0, primitiveType = PrimitiveType.TEXT)
    String getName();

    /**
     * @return 数据库根目录
     */
    @DataField(order = 1, primitiveType = PrimitiveType.TEXT)
    String getRootDir();

    /**
     * @return 数据库分片数量
     */
    @DataField(order = 2, primitiveType = PrimitiveType.INT32)
    Integer getPartitions();

    /**
     * @return 是否可用
     */
    @DataField(order = 3, primitiveType = PrimitiveType.BOOLEAN)
    boolean isEnable();

}
